/**
 * 从路径中提取参数
 * @param {string} url
 * @returns
 */
export const getParamsByUrl = (url) => {
  let search = url.includes("?") ? url.split("?")[1] : url;
  let params = {};

  search.split("&").forEach((vars) => {
    let value = vars.split("=") || [vars];
    params[value[0]] = value[1];
  });

  return params;
};
